interface kInter{
  length:number
}
function echo<T extends kInter>(arg:T){
  console.log(arg.length)
  return arg
}
console.log(echo({name:1,length:2}))
console.log(echo([1,2,3]))
console.log(echo("123132"))

class Ctrl<T>{
  public list: T[] = [];
  push(item:T){
    this.list.push(item)
  }
  pop():T{
    return this.list.pop()
  }
}
var c1=new Ctrl<string>();
c1.push("你好");
c1.push("你好");


// vue3的特点
    // 双向绑定原理发生变化
      // Object.defineProperty()
      // proxy代理
       // 更好的支持了ts 
      //  新增了compositionApi

interface List<T,U,F>{
  name:T,
  age:U,
  say():F
}
let helloobj:List<string,number,boolean>={
    name:"你好",
    age:18,
    say:()=>{
      return true
    }
}
let myobj:List<number,string,number[]>={
  name:11,
  age:"234",
  say:()=>{
    return [1,2,3]
  }
}